#ifndef ADIFEYE_H
#define ADIFEYE_H

#include <QMainWindow>
#include <QFile>
#include <QMessageBox>

QT_BEGIN_NAMESPACE
namespace Ui { class Adifeye; }
QT_END_NAMESPACE

struct QSO_Fields{
    QString call;
    QString gridsquare;
    QString mode;
    QString rst_sent;
    QString rst_rcvd;
    QString qso_date;
    QString time_on;
    QString qso_date_off;
    QString time_off;
    QString band;
    QString freq;
    QString station_callsign;
    QString my_gridsquare;
    QString tx_pwr;//发射功率，这个是预留的
};

class Adifeye : public QMainWindow
{
    Q_OBJECT

public:
    QString aFileName = "";
    QList<QSO_Fields> *allRecordInFile;
    int recouds_count = 0;


    QSO_Fields record_info;// 每条记录的字段
    int records_count = 0;//记录数量
    int all_QSO_count = 0;//记录所有读取的记录数量

    Adifeye(QWidget *parent = nullptr);
    ~Adifeye();

    bool readRecordSet();
    bool writeRecordSet();
    void clearQsoFiels();



private slots:
    void on_pushButton_clicked();

    void on_pushButton_3_clicked();

    void on_pushButton_4_clicked();

    void on_pushButton_2_clicked();

private:
    Ui::Adifeye *ui;
    bool initADIFFile();

};
#endif // ADIFEYE_H
